package com.hs.sfzy.service.impl;

import com.hs.sfzy.entity.UserCourse;
import com.hs.sfzy.mapper.UserCourseMapper;
import com.hs.sfzy.service.UserCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName UserCourseServiceImpl
 * @Description TODO
 * @Author QinKunPeng
 * @Date 2024年10月29日 14:55
 * @Version 1.0
 */

@Service
@Transactional
public class UserCourseServiceImpl implements UserCourseService {

    @Autowired
    UserCourseMapper userCourseMapper;

    @Override
    public int deleteUserCourse(long id) {
        return userCourseMapper.deleteById(id);
    }

    @Override
    public int insert(UserCourse userCourse) {
        return userCourseMapper.insert(userCourse);
    }

    @Override
    public int deleteByCourseIdAndUserId(UserCourse userCourse) {
        return userCourseMapper.deleteByCourseIdAndUserId(userCourse);
    }
}
